//**************************************************************************
//
//         (C) Okulov Rostislav, 2011
//
/*
 ***************************************************************************
 *                                                                         *
 *   This source is free software; you can redistribute it and/or modify   *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 3 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This code is distributed in the hope that it will be useful, but      *
 *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
 *   General Public License for more details.                              *
 *                                                                         *
 *   A copy of the GNU General Public License is available on the World    *
 *   Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also      *
 *   obtain it by writing to the Free Software Foundation,                 *
 *   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.        *
 *                                                                         *
 */

import javax.media.opengl.*;
import javax.media.opengl.GLAutoDrawable;

public class tdim {
	
	float x, y, z;
	float ang;
	boolean enable;
	
	class TVector_plus_ang {
	    float X, Y, Z;
	    float ang;
	}
	
	TVector_plus_ang[] dim_ot_gusenyc = new TVector_plus_ang[9];
	
	public void draw(int dim_tex, GLAutoDrawable drawable){ //GLuint
		float dim_ang;
		GL gl = drawable.getGL();
		
	    gl.glPushMatrix();
		gl.glAlphaFunc(GL.GL_GREATER, 0.1f);
		gl.glEnable(GL.GL_ALPHA_TEST);
        for (int i=0;i<9;i++) {
		    //dim_ang := le_ViewToTarget(le_GetVector(pot1.X, 0, pot1.Z), le_GetVector(dim_ot_gusenyc[i].X, 0.01, dim_ot_gusenyc[i].Z));
		    /**le_RenderBillboard(le_GetVector(dim_ot_gusenyc[i].X - 0.05,
		                       0.01,
		                       dim_ot_gusenyc[i].Z - 0.1),
		                       0.014,
		                       dim_tex);

		    le_RenderBillboard(le_GetVector(dim_ot_gusenyc[i].X + 0.05,
		                       0.01,
		                       dim_ot_gusenyc[i].Z - 0.1),
		                       0.014,
		                       dim_tex); */

		    //glTranslatef(dim_ot_gusenyc[i].X - 0.05f, 0.01f, dim_ot_gusenyc[i].Z - 0.1f);
		    gl.glRotatef(dim_ot_gusenyc[i].ang, 0, 1, 0);
		    gl.glBegin(GL.GL_QUADS);
		    gl.glTexCoord2f(0.0f, 0.0f); gl.glVertex3f(0.0f, 0.0f, 0.0f);
		    gl.glTexCoord2f(0.0f, 1.0f); gl.glVertex3f(0.0f, 0.1f, 0.0f);
		    gl.glTexCoord2f(1.0f, 1.0f); gl.glVertex3f(0.1f, 0.1f, 0.0f);
		    gl.glTexCoord2f(1.0f, 0.0f); gl.glVertex3f(0.1f, 0.0f, 0.0f);
		    gl.glEnd();
        }
		gl.glDisable(GL.GL_ALPHA_TEST);
		gl.glPopMatrix();
	}
	  
	  
}
